Don't bail if the VM renaming at the end of saving doesn't succeed -- we
authorEwan Mellor <ewan@xensource.com>
Tue, 28 Nov 2006 11:35:10 +0000 (11:35 +0000)
committerEwan Mellor <ewan@xensource.com>
Tue, 28 Nov 2006 11:35:10 +0000 (11:35 +0000)
expect a failure if this is a localhost migration.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendCheckpoint.py

index 699a179fe56a9af6b5af0b8c8afb9bd6e97c1b5f..3d5bdc97325605e8eb27915c5aa1ec7709c29bd5 100644 (file)
@@ -37,6 +37,7 @@ def write_exact(fd, buf, errmsg):
     if os.write(fd, buf) != len(buf):
         raise XendError(errmsg)
 
+
 def read_exact(fd, size, errmsg):
     buf  = '' 
     while size != 0: 
@@ -50,7 +51,6 @@ def read_exact(fd, size, errmsg):
     return buf
 
 
-
 def save(fd, dominfo, network, live, dst):
     write_exact(fd, SIGNATURE, "could not write guest state file: signature")
 
@@ -97,7 +97,14 @@ def save(fd, dominfo, network, live, dst):
         forkHelper(cmd, fd, saveInputHandler, False)
 
         dominfo.destroyDomain()
-        dominfo.setName(domain_name)
+        try:
+            dominfo.setName(domain_name)
+        except VmError:
+            # Ignore this.  The name conflict (hopefully) arises because we
+            # are doing localhost migration; if we are doing a suspend of a
+            # persistent VM, we need the rename, and don't expect the
+            # conflict.  This needs more thought.
+            pass
 
     except Exception, exn:
         log.exception("Save failed on domain %s (%s).", domain_name,